﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CommunitySystem.Elements
{
    public partial class ModelTitlebar : UserControl
    {
        public ModelTitlebar()
        {
            InitializeComponent();
        }

        public string Title
        {
            get { return tbTitle.Text; }
            set { tbTitle.Text = value; }
        }

        public UIElement Content
        {
            get 
            {
                if (childHolder.Children.Count == 0)
                {
                    return null;
                }
                return childHolder.Children[0];
            }
            set
            {
                childHolder.Children.Clear();
                childHolder.Children.Add(value);
            }
        }

        //public ImageSource IconSource
        //{
        //    get { return imgIcon.Source; }
        //    set 
        //    {
        //        if (value != null)
        //        {
        //            imgGrid.Visibility = Visibility.Visible;
        //        }
        //        else
        //        {
        //            imgGrid.Visibility = Visibility.Collapsed;
        //        }
        //        imgIcon.Source = value; 
        //        imgIconBg.Source = value; 
        //    }
        //}
    }
}
